/**
 * 
 */
package com.ziguang.common.interceptor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * @author Administrator
 *
 */
public class GlobalActionInterceptor implements Interceptor {
	
	private static final Logger log  = LoggerFactory.getLogger(GlobalActionInterceptor.class);

	@Override
	public void intercept(Invocation inv) {
		log.info(String.format("进入%s Controller ----> %s方法", inv.getActionKey(), inv.getMethod().getName()));
		try {
			inv.invoke();
		} catch (Exception e) {
			log.error(String.format("%s Controller ----> %s出现问题", inv.getActionKey(), inv.getMethod().getName()), e);
		}
		log.info(String.format("结束%s Controller ----> %s方法", inv.getActionKey(), inv.getMethod().getName()));
		
	}

}
